﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:local="clr-namespace:CPPEI.Coolzon.Designer.Shell"
                    xmlns:views="clr-namespace:CPPEI.Coolzon.Designer.Views;assembly=CPPEI.Coolzon.Designer.Views"
                    xmlns:shell="clr-namespace:Microsoft.Windows.Shell;assembly=Microsoft.Windows.Shell">
    <ControlTemplate x:Key="WindowControlTemplate" TargetType="{x:Type Window}">
        <Border Background="#FFF0F0F0" BorderThickness="0">
            <Grid  >
                <Grid.RowDefinitions>
                    <RowDefinition Height="28" />
                    <RowDefinition Height="*"/>
                </Grid.RowDefinitions>
                <Grid Grid.Column="0" Grid.Row="0" >
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="*"/>
                        <ColumnDefinition Width="Auto"/>
                    </Grid.ColumnDefinitions>
                    <Grid.Background>
                        <ImageBrush ImageSource="./Images/标题.jpg" Stretch="Fill"/>
                    </Grid.Background>
                    <Label Grid.Column="0" Grid.Row="0" Grid.ColumnSpan="2" Content="{TemplateBinding Title}" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" FontSize="18" >
                    </Label>
                    <!-- Captions Buttons to control the window borderless-->
                    <local:CaptionButtons Margin="0,0,3,0" Grid.Row="0" Grid.Column="1" HorizontalAlignment="Right"  FontSize="14" 
                                        VerticalAlignment="Center" shell:WindowChrome.IsHitTestVisibleInChrome="True" />
                </Grid>
                

                <ContentPresenter Margin="2,0,2,2" Grid.Row="1" Content="{TemplateBinding Content}"/>
            </Grid>
        </Border>
    </ControlTemplate>

    <Style x:Key="WindowStyle" TargetType="{x:Type Window}">
        <Setter Property="shell:WindowChrome.WindowChrome">
            <Setter.Value>
                <shell:WindowChrome  
                        ResizeBorderThickness="4"
                        CaptionHeight="28"
                        CornerRadius="0"
                        GlassFrameThickness="0,0,0,0" />
            </Setter.Value>
        </Setter>
        <Setter Property="Template" Value="{DynamicResource WindowControlTemplate}"/>
        <Setter Property="Icon" Value="pack://application:,,,/CPPEI.Coolzon.Designer.Shell;component/CNPC-coolzon-logo.ico"/>
        <Setter Property="ShowInTaskbar" Value="False"/>
        <Setter Property="Topmost" Value="True"/>
    </Style>

</ResourceDictionary>